package com.mlog.njyjy.ndop.msg.common.domain;

import com.jfinal.plugin.activerecord.Model;
import com.mlog.njyjy.ndop.msg.common.domain.core.Timeable;
import com.mlog.njyjy.ndop.msg.common.support.Constants;
import com.mlog.njyjy.ndop.share.sql.annotation.Column;
import com.mlog.njyjy.ndop.share.sql.annotation.Id;
import com.mlog.njyjy.ndop.share.sql.annotation.Table;
import com.mlog.njyjy.ndop.share.sql.annotation.TableUnique;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author zyz
 * @version v1.0, 2020/8/11
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@Table(prefix = Constants.TBL_MSG_PREFIX,
        uniques = {@TableUnique(columns = {"flowId", "sequence"})},
        comment = "流程节点次序表")
public class SourceSequence extends Model<SourceSequence> implements Timeable {

    @Id
    private Long id;

    @Column(comment = "流程id", nullable = false)
    private Long flowId;

    @Column(comment = "节点id", nullable = false)
    private Long sourceId;

    @Column(comment = "节点次序")
    private int sequence;


    @Column(updatable = false)
    private LocalDateTime createAt;

    private LocalDateTime updateAt;
}
